<template>
    <div class="workbench-front">
      <a-row type="flex" justify="space-around" align="middle">
        <a-col :span="14" >
          <a-row type="flex" justify="space-around" align="top">
            <a-col :span="16" style="background: #40a9ff">
              {{value}}
              <br>
              <q-districts-cascader :change-on-select="true"/>
            </a-col>
            <a-col :span="8" style="background: #587d9a">
              <a-calendar   />
            </a-col>
          </a-row>
        </a-col>
      </a-row>
    </div>
</template>

<script>
import QDistrictsCascader from '@/components/QDistrictsCascader/QDistrictsCascader';
import aes from '@/utils/security/aes';
import CryptoJS from 'crypto-js';
export default {
  name: 'WorkbenchFront',
  components: {
    QDistrictsCascader
  },
  mounted() {
  },
  data () {
    return {
      value: {}
    }
  },
  created() {
    console.log(aes.encrypt('12345'),'e1')
    console.log(aes.decrypt('5k9i6BLhDaJQwrqXCTyYPA=='),'e1')
    console.log(aes.generatekey(32), '密钥')
    let a = '67fcefcb151f929658334b09bce04a90'.toUpperCase()
    a =  CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(a))

    this.value = aes.decrypt(a,'w1657073886871gb')
    console.log(this.value,'value')
  },
  methods: {
    getListData(value) {
      let listData;
      switch (value.date()) {
        case 8:
          listData = [
            { type: 'warning', content: 'This is warning event.' },
            { type: 'success', content: 'This is usual event.' },
          ];
          break;
        case 10:
          listData = [
            { type: 'warning', content: 'This is warning event.' },
            { type: 'success', content: 'This is usual event.' },
            { type: 'error', content: 'This is error event.' },
          ];
          break;
        case 15:
          listData = [
            { type: 'warning', content: 'This is warning event' },
            { type: 'success', content: 'This is very long usual event。。....' },
            { type: 'error', content: 'This is error event 1.' },
            { type: 'error', content: 'This is error event 2.' },
            { type: 'error', content: 'This is error event 3.' },
            { type: 'error', content: 'This is error event 4.' },
          ];
          break;
        default:
      }
      return listData || [];
    },
    getMonthData(value) {
      if (value.month() === 8) {
        return 1394;
      }
    }
  },
  inject: ['toIndex']
};
</script>

<style lang="less" scoped>
  .workbench-front{
    width: 100%;
    height: 100%;
    overflow: auto;
  }
</style>
